package com.example.userconsumer.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author likaiping
 * @createTime 2024/7/5 20:55
 */
@RestController
@RefreshScope //自动刷新bean属性 不用重启
@RequestMapping("/test")
public class TestNacosController {
    @Value("${name}")
    private String testName;

    @GetMapping(value = "/testnacos")
    public String tologin() {
        return "testnacos"+"测试拿到的testName为："+testName;
    }
}
